#{extends 'main.html' /}
<div class="page-group">
    <div class="page page-current" id="work-order-detail">
        <header class="bar bar-nav">
            <a href="javascript:history.go(-1);" class="icon icon-left pull-left"></a>
            <h1 class="title">工单详情</h1>
        </header>
        <section class="payDetail content scroll_y">
            <div class="card0 m6">
                <div class="card-content">
                    <ul>
                        <li>
                            <h3 id="work-detail-name">${issue?.issueName}</h3>
                        </li>
                        <li>
                            <h3>报修人：${issue?.user?.realName}</h3>
                        </li>
                        <li>
                            <h3>联系电话：${issue?.phone}</h3>
                        </li>
                        <li>
                            <h3 id="work-detial-time">上门时间：${issue?.visitTimeBegin}~${issue?.visitTimeEnd}</h3>
                        </li>
                        <li>
                            <h3>描述说明：${issue?.remark}</h3>
                        </li>
                    </ul>
                </div>
                <div class="card-footer">
                    <div class="content-block uploadPic">
                        <ul>
                        #{list images , as :'image'}
                            <li class="img">
                                <img src="${image?.ossPath}"/>
                            </li>
                        #{/list}
                        </ul>
                    </div>
                </div>
            </div>

        </section>

    #{include 'weixin/footer.html'/}

    </div>
</div>

<script type="text/javascript">
    $(function(){
        var name_ = $("#work-detail-name").html();
        if(name_.indexOf(",") != -1){
            var room_ = name_.split(",")[0];
            var type_ = name_.split(",")[1];
            $("#work-detail-name").html(room_);
            $("#work-detail-name").parent().after($("<li> <h3>"+type_+"</h3></li>"));
        }
        var time_ = $("#work-detial-time").html();
        if(time_.indexOf("~") != -1){
            var start_ = time_.split("~")[0];
            var end_ = time_.split("~")[1];
            var date_ = start_.split(" ")[0];
            var startHour = parseInt(start_.split(" ")[1].split(".")[0]);
            var endHour = parseInt(end_.split(" ")[1].split(".")[0]);
            $("#work-detial-time").html(date_ +"&nbsp;&nbsp;&nbsp;"+startHour+"点-"+endHour+"点");
        }
    })
    $.init();
    $(".lunbo").swiper({
        autoplay: 3000  //可选选项，自动滑动
    });

    // 检测高度

    $(".content").on("scroll", function () {
        if ($('.content').scrollTop() > 100) {
            $('.bar-nav0').addClass("active");
        } else {
            $('.bar-nav0').removeClass("active");
        }
    });
</script>